<?php

/**
 * KTDForum form.
 *
 * @package    s-test
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */

class KTDForumForm extends BaseKTDForumForm
{
  public function configure()
  {
  }
}


class BackendKTDForumForm extends BaseKTDForumForm{
    public static $_LOGO_DIR = "/uploads/images/forums/icon";
    public function configure(){
               $this->setWidget("icon", new sfWidgetFormInputFileEditable(array(
               'label' => 'Icône du forum',
               'is_image' => true,
               'file_src' => BackendKTDForumForm::$_LOGO_DIR.'/'.$this->getObject()->getIcon(),
               'edit_mode'=> !$this->isNew(),
               'template'  => '%file%<br />%input%<br/>%delete% %delete_label%')));

               $this->validatorSchema['icon'] = new sfValidatorFile(array(
                'required'   => false,
                'path'       => sfConfig::get('sf_upload_dir').'/images/forums/icon',
                'mime_types' => 'web_images',
       ));
    }

}
